function reformat(s: string): string {
    // 如何判断字符串中的数字和字母
    const numArr: string[] = ['0','1','2','3','4','5','6','7','8','9']
    let num: string[] = []
    let abc: string[] = []
    let ans: string = ''
    s.split('').forEach(item => {
        if(numArr.includes(item)){
            num.push(item)
        }else {
            abc.push(item)
        }
    })
    if(num.length>abc.length+1 || num.length<abc.length-1){
        return ''
    }
    if(num.length > abc.length){
        num.forEach((item,index) => {
            ans += item + (abc?.[index] ? abc[index] : '')
        })
    }else{
        abc.forEach((item,index) => {
            ans += item + (num?.[index] ? num[index] : '')
        })
    }
    return ans
};

const s: string = "ab123"
console.log(reformat(s))